#ifndef __UDP_DEF_H
#define __UDP_DEF_H

#include "sdk_ifs_udk_cfg.h"

/*必须保证本结构体大小不改变*/
typedef struct
{

	#if SDK_VERSION < SDK_VERSION_GENE(3,0)
	uint32_t RSV[40-0];
	#else
	uint32_t RSV[30-0];
	#endif
	
	uint16_t crcLen;
	uint16_t crcVal;
}PARAM_CFG;

#define USE_ALG_REDEFINE

#if defined(USE_ALG_REDEFINE) && (SDK_VERSION < SDK_VERSION_GENE(3,0))
typedef struct
{
	uint32_t p2Cfg0;
	uint32_t p2Cfg1;
	uint32_t p2Cfg2;
	uint32_t p2Cfg3;
	uint32_t p2Cfg4;
	uint32_t p2Cfg5;
	uint32_t p2Cfg6;
	uint32_t p2Cfg7;
	uint32_t p2Cfg8;
	uint32_t fftCfg0;
	uint32_t fftCfg1;
	uint32_t fftCfg2;
	uint32_t dstInc;
}P2_FFT_CONFIG_NEW;
typedef struct
{
	uint32_t cfarCfg0;
	uint32_t cfarCfg1;
	uint32_t cfarCfg2;
	uint32_t cfarCfg3;
	uint32_t cfarCfg4;
	uint32_t cfarCfg5;
	uint32_t cfarCfg6;
	uint32_t cfarCfg7;
	uint32_t cfarCfg8;
	uint32_t cfarAbsAddr;
}CFAR_CONFIG_NEW;

typedef struct
{
	P2_FFT_CONFIG_NEW alg0;
	P2_FFT_CONFIG_NEW alg1;
	P2_FFT_CONFIG_NEW alg2;
	P2_FFT_CONFIG_NEW alg3;
	P2_FFT_CONFIG_NEW alg4;
	P2_FFT_CONFIG_NEW alg5;
	P2_FFT_CONFIG_NEW alg6;
	P2_FFT_CONFIG_NEW alg7;
	P2_FFT_CONFIG_NEW alg8;
	P2_FFT_CONFIG_NEW alg9;
	P2_FFT_CONFIG_NEW alg13;
	P2_FFT_CONFIG_NEW alg14;
	P2_FFT_CONFIG_NEW alg15;
	P2_FFT_CONFIG alg16;
	P2_FFT_CONFIG alg17;
	P2_FFT_CONFIG alg18;
	P2_FFT_CONFIG alg19;
	P2_FFT_CONFIG alg21;
	
	P2_FFT_CONFIG_NEW alg23;
	P2_FFT_CONFIG_NEW alg24;	
	P2_FFT_CONFIG_NEW alg25;
	CFAR_CONFIG_NEW alg10_cfar1;
	CFAR_CONFIG_NEW alg11_cfar2;	
	FFT3D_PRE alg12;
	FFT3D_PRE alg20;
	FFT3D_PRE alg30;
	FFT3D_PRE alg31;
	uint32_t algEn;
	
	CFAR_CONFIG_NEW alg28_cfar1;
	CFAR_CONFIG_NEW alg29_cfar2;	
	P2_FFT_CONFIG alg22;
	
	uint8_t rsv[2];
	uint8_t copyEn;
	uint8_t copyFlashEn;
	uint32_t rsvU32B;

	uint16_t crcLen;           //0630
	uint16_t crcVal;           //0632
}PARAM_ALGORITHM_REDEF;
#endif

typedef struct{
	PARAM_ANA_VENUS paraANA;
	PARAM_DATAPREP  paraDataPrep;
	#if defined(USE_ALG_REDEFINE) && (SDK_VERSION < SDK_VERSION_GENE(3,0))
	PARAM_ALGORITHM_REDEF paraALG;
	#else
	PARAM_ALGORITHM paraALG;
	#endif
	PARAM_FUNC      paraFunc;
	PARAM_RUNTIME   paraRT;
	PARAM_CFG       paraCFG;
}UDP_2K_t;

extern const UDP_2K_t UDP_2k_Const;

#define paramCFG        (&(((UDP_2K_t*)UDP_ADDR)->paraCFG))

#define paramANA_Venus  (&(((param_2k_t*)UDP_ADDR)->paramANA))

#if SDK_VERSION < SDK_VERSION_GENE(3,0)
#define paramRT         (&(((UDP_2K_t*)UDP_ADDR)->paraRT))
#if defined(USE_ALG_REDEFINE)
#define paramALG        (&(((UDP_2K_t*)UDP_ADDR)->paraALG))
#else
#define paramALG        (&(((param_2k_t*)UDP_ADDR)->paramALG))
#endif
#endif

#endif

